<template>
  <div class="wrap" v-loading="loading">
    <div class="season">
      <el-row :gutter="24">
        <h4 class="title">{{ $t('userInfo.Basic information') }}</h4>
        <el-col :span="8">
          <el-card shadow="hover">
            <el-col :span="24">
              <div class="item">
                <div class="label">{{ $t('table.user name') }}：</div>
                <div class="value">{{userData.account}}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('user.email') }}：</div>
                <div class="value">{{userData.email}}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('userInfo.Password') }}：</div>
                <div class="value">******</div>
                <div class="option"><el-link :underline="false" type="success" @click="jumpUser">{{ $t('userInfo.Go to the client') }}</el-link></div>
              </div>
            </el-col>

          </el-card>
        </el-col>

        <el-col :span="8" >
          <el-card shadow="hover">
            <el-col :span="24">
              <div class="item">
                <div class="label">{{ $t('table.Total revenue from stickers') }}：</div>
                <div class="value">{{ userData.stickerIncome }}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('table.大货中转总收入（元）') }}：</div>
                <div class="value">{{ userData.totalBigMiddleFee }}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('table.理货总收入（元）') }}：</div>
                <div class="value">{{ userData.totalShipmentIncome }}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('userInfo.Total warehousing revenue') }}：</div>
                <div class="value">{{ userData.storageIncome }}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('table.Total income') }}：</div>
                <div class="value">{{ calTotalIncome }}</div>
              </div>

            </el-col>

          </el-card>
        </el-col>

        <el-col :span="8" >
          <el-card shadow="hover">
            <el-col :span="24">
              <div class="item">
                <div class="label">{{ $t('userInfo.Account creation') }}：</div>
                <div class="value">{{ userData.adminName }}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('table.createTime3') }}：</div>
                <div class="value">{{ userData.createTime }}</div>
              </div>
              <div class="item">
                <div class="label">{{ $t('userInfo.Number of bound stores') }}：</div>
                <div class="value">{{ userData.accountNum }}</div>
              </div>
            </el-col>

          </el-card>
        </el-col>
      </el-row>
    </div>

    <div class="season">
      <el-row :gutter="24">
        <h4 class="title">{{ $t('userInfo.Operations Information') }}</h4>
        <div class="mgl10 mgb10">
          <el-radio-group v-model="currentWarehouseId" v-if="warehouseNum > 1">
            <el-radio-button
              v-for="item in settingByWarehouseList"
              :key="item.id"
              :label="item.id"
            >{{item.warehouseName}}</el-radio-button>
          </el-radio-group>
        </div>
        <el-col
          :span="24"
          class="mgb10"
        >
          <el-card shadow="hover" style="position: relative">
            <el-col :span="8">
              <el-descriptions class="margin-top"  :column="1" size="medium">

                <el-descriptions-item :label="$t('一件代发运营')">
                  <span>{{ userData.oneShippingAdminAccount }}</span>
                </el-descriptions-item>

                <el-descriptions-item :label="$t('中转送仓运营')">
                  <span>{{ userData.middleTransferAdminAccount }}</span>
                </el-descriptions-item>

                <el-descriptions-item :label="$t('userInfo.Cooperation status')">
                  {{ userData.status === 1 ? $t('user.In cooperation') : $t('user.Stop cooperation') }}
                </el-descriptions-item>

                <template v-if="$store.getters.showMenuRemittance">
                  <el-descriptions-item :label="`${$t('userInfo.Collection fee')}`">
                    <template v-if="userData.handlingChargeStatus !== 1">
                      <span style="color: red">{{$t('userInfo.Free of charge')}}</span>
                    </template>
                    <template v-else>
                      <span style="color: red">{{$t('userInfo.Additional charge')}}</span>
                    </template>
                  </el-descriptions-item>
                </template>

                <el-descriptions-item :label="`${$t('pay.Credit limit')}（${$t('common.RMB')}）`">
                  <template v-if="userData.creditAmountType !== 1">
                    <span class="font-red">{{ userSetting.creditAmount }}</span>
                  </template>
                  <template v-else>
                    {{ userSetting.creditAmount }}
                  </template>
                </el-descriptions-item>

                <el-descriptions-item :label="`${$t('table.货箱类型')}`">
                  <template v-if="userSetting.shipmentTableType === 1">
                    {{ $t('setting.整箱和混箱') }}
                  </template>
                  <template v-else>
                    {{ $t('setting.仅整箱') }}
                  </template>
                </el-descriptions-item>

                <el-descriptions-item :label="`${$t('setting.组合商品')}`">
                  <template v-if="userSetting.isOpenCombinationGoods === 1">
                    {{ $t('setting.允许组合') }}
                  </template>
                  <template v-else>
                    {{ $t('setting.不允许') }}
                  </template>
                </el-descriptions-item>

                <el-descriptions-item :label="`${$t('setting.订单同步')}`">
                  <div>
                    <template v-if="userData.orderHiddenType === 1">
                      {{ $t('setting.全部SKU') }}
                    </template>
                    <template v-else>
                      {{ $t('setting.部分SKU') }}
                    </template>

                    <order-hidden
                      style="display: inline;"
                      class="mgl20"
                      :order-hidden-type="userData.orderHiddenType"
                      :select-suit-ids="userData.orderSelectSuitIds"
                      :user-id="userData.id"
                      ref="orderHiddenRef"
                      @changeOrderHidden="getData"
                    >
                      <el-link :underline="false" type="primary" @click="showOrderHiddenDialog()" style="margin-bottom: 2px">{{ $t('common.edit') }}</el-link>
                    </order-hidden>
                  </div>

                </el-descriptions-item>

                <el-descriptions-item :label="`${$t('setting.自动下载面单')}`">
                  <el-tooltip  placement="top">
                    <div slot="content">
                      <p
                        v-for="(item, index) in autoDownloadShippingList"
                        :key="index"
                      >
                       {{item.name}}
                      </p>
                    </div>
                    <div v-if="autoDownloadShipping === true">
                       {{ $t('setting.自动下载') }}
                    </div>
                    <div v-else>
                      {{ $t('setting.不下载') }}
                    </div>
                  </el-tooltip>


                </el-descriptions-item>

                <el-descriptions-item :label="`${$t('setting.自动同步前台库存')}`">
                  <el-tooltip  placement="top">
                    <div slot="content">
                      <p
                        v-for="(item, index) in autoSyncInventoryList"
                        :key="index"
                      >
                       {{item.syncInventoryStr}}
                      </p>
                    </div>
                    <div v-if="autoSyncInventory === true">
                      {{ syncInventoryStr }}
                    </div>
                    <div v-else>
                       {{ $t('setting.不同步') }}
                    </div>
                  </el-tooltip>

                </el-descriptions-item>

              </el-descriptions>
            </el-col>

            <el-col :span="8">
              <el-descriptions class="margin-top"  :column="1" size="medium">

                <!--一件代发-->
                <template v-for="oneShippingPriceItem in userSetting.platformOneShippingPrice">
                  <template v-if="oneShippingPriceItem.goodsSizeStickerPrice.length > 1">
                    <el-descriptions-item :label="`${$t('setting.一件代发')} (${oneShippingPriceItem.accountType}) `" :key="oneShippingPriceItem.accountType">
                      <el-tooltip class="item" effect="dark" placement="top-end">
                        <div slot="content">
                          <p
                            v-for="(item, index) in oneShippingPriceItem.goodsSizeStickerPrice"
                            :key="index"
                          >
                            <template v-if="item.type === 'num'">
                              {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                            </template>
                            <template v-if="item.type === 'weight'">
                              {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                            </template>
                          </p>
                        </div>
                        <div style="padding-bottom: 0;">{{ oneShippingPriceItem.goodsSizeStickerPrice.length }}{{$t('setting.个重量段')}}</div>
                      </el-tooltip>
                    </el-descriptions-item>
                  </template>
                  <template v-else>
                    <el-descriptions-item v-for="(item, index) in oneShippingPriceItem.goodsSizeStickerPrice" :key="index" :label="`${$t('setting.一件代发')} (${oneShippingPriceItem.accountType}) `">
                      <template v-if="item.type === 'num'">
                        {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                      </template>
                      <template v-if="item.type === 'weight'">
                        {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                      </template>
                    </el-descriptions-item>
                  </template>
                </template>

                <!--快递平台面单-->
                <template v-for="oneShippingPriceItem in userSetting.platformOneShippingPrice">
                  <template v-if="oneShippingPriceItem.accountType === 'MercadoLibre'">
                    <template v-if="oneShippingPriceItem.logisticDropOffPrice.length > 1">
                      <el-descriptions-item :label="`${$t('setting.快递-平台面单')} (${oneShippingPriceItem.accountType}) `" :key="oneShippingPriceItem.accountType">
                        <el-tooltip class="item" effect="dark" placement="top-end">
                          <div slot="content">
                            <p
                              v-for="(item, index) in oneShippingPriceItem.logisticDropOffPrice"
                              :key="index"
                            >
                              <template v-if="item.type === 'num'">
                                {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                              </template>
                              <template v-if="item.type === 'weight'">
                                {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                              </template>
                            </p>
                          </div>
                          <div style="padding-bottom: 0;">{{ oneShippingPriceItem.logisticDropOffPrice.length }}{{$t('setting.个重量段')}}</div>
                        </el-tooltip>
                      </el-descriptions-item>
                    </template>
                    <template v-else>
                      <el-descriptions-item v-for="(item, index) in oneShippingPriceItem.logisticDropOffPrice" :key="index" :label="`${$t('setting.快递-平台面单')} (${oneShippingPriceItem.accountType}) `">
                        <template v-if="item.type === 'num'">
                          {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                        </template>
                        <template v-if="item.type === 'weight'">
                          {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                        </template>
                      </el-descriptions-item>
                    </template>
                  </template>
                </template>

                <!--快递无面单-->
                <template v-for="oneShippingPriceItem in userSetting.platformOneShippingPrice">
                  <template v-if="oneShippingPriceItem.logisticCustomPrice.length > 1">
                    <el-descriptions-item :label="`${$t('setting.快递-无面单')} (${oneShippingPriceItem.accountType}) `" :key="oneShippingPriceItem.accountType">
                      <el-tooltip class="item" effect="dark" placement="top-end">
                        <div slot="content">
                          <p
                            v-for="(item, index) in oneShippingPriceItem.logisticCustomPrice"
                            :key="index"
                          >
                            <template v-if="item.type === 'num'">
                              {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                            </template>
                            <template v-if="item.type === 'weight'">
                              {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                            </template>
                          </p>
                        </div>
                        <div style="padding-bottom: 0;">{{ oneShippingPriceItem.logisticCustomPrice.length }}{{$t('setting.个重量段')}}</div>
                      </el-tooltip>
                    </el-descriptions-item>
                  </template>
                  <template v-else>
                    <el-descriptions-item v-for="(item, index) in oneShippingPriceItem.logisticCustomPrice" :key="index" :label="`${$t('setting.快递-无面单')} (${oneShippingPriceItem.accountType}) `">
                      <template v-if="item.type === 'num'">
                        {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                      </template>
                      <template v-if="item.type === 'weight'">
                        {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                      </template>
                    </el-descriptions-item>
                  </template>
                </template>

                <!--操作费-->
                <template v-for="oneShippingPriceItem in userSetting.platformOneShippingPrice">
                  <el-descriptions-item :label="`${$t('setting.操作费')} (${oneShippingPriceItem.accountType}) `" :key="oneShippingPriceItem.accountType">
                    {{oneShippingPriceItem.customPrice}}{{$t('setting.元/单')}}
                  </el-descriptions-item>
                </template>

                <!--Flex-->
                <template v-for="oneShippingPriceItem in userSetting.platformOneShippingPrice">
                  <template v-if="oneShippingPriceItem.accountType === 'MercadoLibre'">
                    <template v-if="oneShippingPriceItem.logisticSelfServicePrice.length > 1">
                      <el-descriptions-item :label="`${$t('setting.Flex')} (${oneShippingPriceItem.accountType}) `" :key="oneShippingPriceItem.accountType">
                        <el-tooltip class="item" effect="dark" placement="top-end">
                          <div slot="content">
                            <p
                              v-for="(item, index) in oneShippingPriceItem.logisticSelfServicePrice"
                              :key="index"
                            >
                              <template v-if="item.type === 'num'">
                                {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                              </template>
                              <template v-if="item.type === 'weight'">
                                {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                              </template>
                            </p>
                          </div>
                          <div style="padding-bottom: 0;">{{ oneShippingPriceItem.logisticSelfServicePrice.length }}{{$t('setting.个重量段')}}</div>
                        </el-tooltip>
                      </el-descriptions-item>
                    </template>
                    <template v-else>
                      <el-descriptions-item v-for="(item, index) in oneShippingPriceItem.logisticSelfServicePrice" :key="index" :label="`${$t('setting.Flex')} (${oneShippingPriceItem.accountType}) `">
                        <template v-if="item.type === 'num'">
                          {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                        </template>
                        <template v-if="item.type === 'weight'">
                          {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                        </template>
                      </el-descriptions-item>
                    </template>
                  </template>
                </template>

                <!--Colecta-->
                <template v-for="oneShippingPriceItem in userSetting.platformOneShippingPrice">
                  <template v-if="oneShippingPriceItem.accountType === 'MercadoLibre'">
                    <template v-if="oneShippingPriceItem.logisticCrossDockingPrice.length > 1">
                      <el-descriptions-item :label="`${$t('setting.Colecta')} (${oneShippingPriceItem.accountType}) `" :key="oneShippingPriceItem.accountType">
                        <el-tooltip class="item" effect="dark" placement="top-end">
                          <div slot="content">
                            <p
                              v-for="(item, index) in oneShippingPriceItem.logisticCrossDockingPrice"
                              :key="index"
                            >
                              <template v-if="item.type === 'num'">
                                {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                              </template>
                              <template v-if="item.type === 'weight'">
                                {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                              </template>
                            </p>
                          </div>
                          <div style="padding-bottom: 0;">{{ oneShippingPriceItem.logisticCrossDockingPrice.length }}{{$t('setting.个重量段')}}</div>
                        </el-tooltip>
                      </el-descriptions-item>
                    </template>
                    <template v-else>
                      <el-descriptions-item v-for="(item, index) in oneShippingPriceItem.logisticCrossDockingPrice" :key="index" :label="`${$t('setting.Colecta')} (${oneShippingPriceItem.accountType}) `">
                        <template v-if="item.type === 'num'">
                          {{$t('setting.数量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元')}}
                        </template>
                        <template v-if="item.type === 'weight'">
                          {{$t('setting.重量')}}：≥{{item.weight}}kg，{{$t('setting.首')}}{{item.PSCFirst}}{{$t('setting.元/kg')}}，{{$t('setting.续')}}{{item.PSCAppend}}{{$t('setting.元/kg')}}
                        </template>
                      </el-descriptions-item>
                    </template>
                  </template>
                </template>

              </el-descriptions>
            </el-col>

            <el-col :span="8">
              <el-descriptions class="margin-top"  :column="1" size="medium">

                <!--包材-->
                <template v-if="userSetting.packageMaterial.length > 1">
                  <el-descriptions-item :label="`${$t('order.Packaging materials or Services')}`">
                    <el-tooltip class="item" effect="dark" placement="top-end">
                      <div slot="content">
                        <p
                          v-for="(item, index) in userSetting.packageMaterial"
                          :key="index"
                        >
                          {{ item.name }}，{{ item.price }}{{$t('setting.unit1')}}
                        </p>
                      </div>
                      <div style="padding-bottom: 0;">{{ userSetting.packageMaterial.length }}{{$t('setting.个包材')}}</div>
                    </el-tooltip>
                  </el-descriptions-item>
                </template>
                <template v-else>
                  <el-descriptions-item v-for="(item, index) in userSetting.packageMaterial" :key="index" :label="`${$t('order.Packaging materials or Services')}`">
                    <template v-if="packageMaterialType !== 1">
                      ({{ item.name }}) <span style="color: red">{{ item.price }}</span>
                      <span style="margin-left: 5px; color: red">{{$t('setting.unit1')}}</span>
                    </template>
                    <template v-else>
                      ({{ item.name }}) {{ item.price }}
                      <span style="margin-left: 5px">{{$t('setting.unit1')}}</span>
                    </template>
                  </el-descriptions-item>
                </template>

                <!--送仓单价（常规）-->
                <template v-if="userSetting.middleGeneralPrice.length > 1">
                  <el-descriptions-item :label="`${$t('table.送仓单价（常规）')}`">
                    <el-tooltip class="item" effect="dark" placement="top-end">
                      <div slot="content">
                        <p
                          v-for="(item, index) in userSetting.middleGeneralPrice"
                          :key="index"
                        >
                          ≥{{item.weight}}kg，{{item.price}}{{$t('table.元/箱')}}
                        </p>
                      </div>
                      <div style="padding-bottom: 0;">{{ userSetting.middleGeneralPrice.length }}{{$t('setting.个重量段')}}</div>
                    </el-tooltip>
                  </el-descriptions-item>
                </template>
                <template v-else>
                  <el-descriptions-item
                    v-for="(item,index) in userSetting.middleGeneralPrice"
                    :key="index"
                    :label="`${$t('table.送仓单价（常规）')}`"
                  >
                  <span>
                    ≥{{item.weight}}kg
                  </span>
                    <span class="mgl10">
                    {{item.price}}{{$t('table.元/箱')}}
                  </span>
                  </el-descriptions-item>
                </template>

                <!--送仓单价（快递）-->
                <template v-if="userSetting.middleExpressPrice.length > 1">
                  <el-descriptions-item :label="`${$t('table.送仓单价（快递）')}`">
                    <el-tooltip class="item" effect="dark" placement="top-end">
                      <div slot="content">
                        <p
                          v-for="(item, index) in userSetting.middleExpressPrice"
                          :key="index"
                        >
                          ≥{{item.weight}}kg，{{item.price}}{{$t('table.元/箱')}}
                        </p>
                      </div>
                      <div style="padding-bottom: 0;">{{ userSetting.middleExpressPrice.length }}{{$t('setting.个重量段')}}</div>
                    </el-tooltip>
                  </el-descriptions-item>
                </template>
                <template v-else>
                  <el-descriptions-item
                    v-for="(item,index) in userSetting.middleExpressPrice"
                    :key="index"
                    :label="`${$t('table.送仓单价（快递）')}`"
                  >
                  <span>
                    ≥{{item.weight}}kg
                  </span>
                    <span class="mgl10">
                    {{item.price}}{{$t('table.元/箱')}}
                  </span>
                  </el-descriptions-item>
                </template>

                <!--调货单价-->
                <template v-if="userSetting.transferFeeList.length > 1">
                  <el-descriptions-item :label="`${$t('table.调货单价')}`">
                    <el-tooltip class="item" effect="dark" placement="top-end">
                      <div slot="content">
                        <p
                          v-for="(item, index) in userSetting.transferFeeList"
                          :key="index"
                        >
                          ≥{{item.weight}}kg，{{item.price}}{{$t('table.元/箱')}}
                        </p>
                      </div>
                      <div style="padding-bottom: 0;">{{ userSetting.transferFeeList.length }}{{$t('setting.个重量段')}}</div>
                    </el-tooltip>
                  </el-descriptions-item>
                </template>
                <template v-else>
                  <el-descriptions-item
                    v-for="(item,index) in userSetting.transferFeeList"
                    :key="index"
                    :label="`${$t('table.调货单价')}`"
                  >
                  <span>
                    ≥{{item.weight}}kg
                  </span>
                    <span class="mgl10">
                    {{item.price}}{{$t('table.元/箱')}}
                  </span>
                  </el-descriptions-item>
                </template>

                <el-descriptions-item :label="$t('table.包车单价（元）')">
                  <template v-if="userSetting.transferPriceType !== 1">
                    <span style="color: red">{{ userSetting.charteredCarFee }}</span>
                  </template>
                  <template v-else>
                    {{ userSetting.charteredCarFee }}
                  </template>
                </el-descriptions-item>

                <el-descriptions-item :label="$t('table.贴SKU标单价（元）')">
                  <template v-if="userSetting.transferPriceType !== 1">
                    <span style="color: red">{{ userSetting.goodsLabelFee }}</span>
                  </template>
                  <template v-else>
                    {{ userSetting.goodsLabelFee }}
                  </template>
                </el-descriptions-item>

                <el-descriptions-item :label="$t('table.贴外箱标单价（元）')">
                  <template v-if="userSetting.transferPriceType !== 1">
                    <span style="color: red">{{ userSetting.boxLabelFee }}</span>
                  </template>
                  <template v-else>
                    {{ userSetting.boxLabelFee }}
                  </template>
                </el-descriptions-item>

                <!--上架单价（一件代发）-->
                <template v-if="userSetting.shipmentOneWeightPrice.length > 1">
                  <el-descriptions-item :label="`${$t('table.上架单价（一件代发）')}`">
                    <el-tooltip class="item" effect="dark" placement="top-end">
                      <div slot="content">
                        <p
                          v-for="(item, index) in userSetting.shipmentOneWeightPrice"
                          :key="index"
                        >
                          ≥{{item.weight}}kg，{{item.price}}{{$t('table.元/个')}}
                        </p>
                      </div>
                      <div style="padding-bottom: 0;">{{ userSetting.shipmentOneWeightPrice.length }}{{$t('setting.个重量段')}}</div>
                    </el-tooltip>
                  </el-descriptions-item>
                </template>
                <template v-else>
                  <el-descriptions-item
                    v-for="(item,index) in userSetting.shipmentOneWeightPrice"
                    :key="index"
                    :label="`${$t('table.上架单价（一件代发）')}`"
                  >
                  <span>
                    ≥{{item.weight}}kg
                  </span>
                    <span class="mgl10">
                    {{item.price}}{{$t('table.元/个')}}
                  </span>
                  </el-descriptions-item>
                </template>

                <!--上架单价（中转送仓）-->
                <template v-if="userSetting.shipmentMiddleWeightPrice.length > 1">
                  <el-descriptions-item :label="`${$t('table.上架单价（中转送仓）')}`">
                    <el-tooltip class="item" effect="dark" placement="top-end">
                      <div slot="content">
                        <p
                          v-for="(item, index) in userSetting.shipmentMiddleWeightPrice"
                          :key="index"
                        >
                          ≥{{item.weight}}kg，{{item.price}}{{$t('table.元/箱')}}
                        </p>
                      </div>
                      <div style="padding-bottom: 0;">{{ userSetting.shipmentMiddleWeightPrice.length }}{{$t('setting.个重量段')}}</div>
                    </el-tooltip>
                  </el-descriptions-item>
                </template>
                <template v-else>
                  <el-descriptions-item
                    v-for="(item,index) in userSetting.shipmentMiddleWeightPrice"
                    :key="index"
                    :label="`${$t('table.上架单价（中转送仓）')}`"
                  >
                  <span>
                    ≥{{item.weight}}kg
                  </span>
                    <span class="mgl10">
                    {{item.price}}{{$t('table.元/箱')}}
                  </span>
                  </el-descriptions-item>
                </template>

                <!--仓储-->
                <template
                  v-for="storageItem in currentWarehouseStorageFeeWeightRange"
                >
                  <el-descriptions-item :label="`${storageItem.warehouseName}${$t('免仓期')}`" :key="storageItem.warehouseId">
                    {{storageItem.freeStorageDay}} {{$t('天')}}
                  </el-descriptions-item>

                  <template v-if="storageItem.stockNumRangeList.length > 1">
                    <el-descriptions-item :label="`${storageItem.warehouseName}${$t('仓储单价（一件代发）')}`" :key="storageItem.warehouseId">
                      <el-tooltip class="item" effect="dark" placement="top-end">
                        <div slot="content">
                          <p
                            v-for="stockRange in storageItem.stockNumRangeList"
                            :key="stockRange.weight"
                          >
                            ≥{{stockRange.weight}}kg，{{stockRange.price}}{{$t('元/个/天')}}
                          </p>
                        </div>
                        <div style="padding-bottom: 0;">{{ storageItem.stockNumRangeList.length }}{{$t('setting.个重量段')}}</div>
                      </el-tooltip>
                    </el-descriptions-item>
                  </template>
                  <template v-else>
                    <el-descriptions-item
                      v-for="stockRange in storageItem.stockNumRangeList"
                      :key="stockRange.weight"
                      :label="`${storageItem.warehouseName}${$t('仓储单价（一件代发）')}`"
                    >
                      ≥{{stockRange.weight}}kg {{stockRange.price}}{{$t('元/个/天')}}
                    </el-descriptions-item>
                  </template>

                  <template v-if="storageItem.middleStockNumRangeList.length > 1">
                    <el-descriptions-item :label="`${storageItem.warehouseName}${$t('仓储单价（中转送仓）')}`" :key="storageItem.warehouseId">
                      <el-tooltip class="item" effect="dark" placement="top-end">
                        <div slot="content">
                          <p
                            v-for="stockRange in storageItem.middleStockNumRangeList"
                            :key="stockRange.weight"
                          >
                            ≥{{stockRange.weight}}kg，{{stockRange.price}}{{$t('元/箱/天')}}
                          </p>
                        </div>
                        <div style="padding-bottom: 0;">{{ storageItem.middleStockNumRangeList.length }}{{$t('setting.个重量段')}}</div>
                      </el-tooltip>
                    </el-descriptions-item>
                  </template>
                  <template v-else>
                    <el-descriptions-item
                      v-for="stockRange in storageItem.middleStockNumRangeList"
                      :key="stockRange.weight"
                      :label="`${storageItem.warehouseName}${$t('仓储单价（中转送仓）')}`"
                    >
                      ≥{{stockRange.weight}}kg {{stockRange.price}}{{$t('元/箱/天')}}
                    </el-descriptions-item>
                  </template>

                </template>

              </el-descriptions>
            </el-col>

            <div style="position: absolute;right: 20px">
              <el-link :underline="false" type="primary" @click="showEditUser">{{ $t('common.edit') }}</el-link>
            </div>

          </el-card>
        </el-col>


      </el-row>
    </div>


      <div class="season">
        <el-row :gutter="24">
          <h4 class="title">{{ $t('userInfo.客户信息') }}</h4>
            <el-card shadow="hover" style="position: relative">
              <el-col :span="8">
                <el-descriptions class="margin-top"  :column="1" size="medium">

                  <el-descriptions-item :label="$t('user.客户全称')">
                    <span>{{ userData.customer_name }}</span>
                  </el-descriptions-item>

                  <el-descriptions-item :label="$t('user.公司地址')">
                    <span>{{ userData.customer_address }}</span>
                  </el-descriptions-item>

                  <el-descriptions-item :label="$t('user.销售员')">
                    {{ userData.customer_sale_name }}
                  </el-descriptions-item>
                </el-descriptions>
              </el-col>
              <el-col :span="8">
                <el-descriptions class="margin-top"  :column="1" size="medium">

                  <el-descriptions-item :label="$t('user.负责人')">
                    <span>{{ userData.customer_charge }}</span>
                  </el-descriptions-item>

                  <el-descriptions-item :label="$t('user.客户类型')">
                    <span>{{ customerType[userData.customer_type] }}</span>
                  </el-descriptions-item>

                  <el-descriptions-item :label="$t('user.港前客服')">
                    {{ userData.customer_service_name }}
                  </el-descriptions-item>

                </el-descriptions>
              </el-col>
              <el-col :span="8">
                <el-descriptions class="margin-top"  :column="1" size="medium">

                  <el-descriptions-item :label="$t('user.联系电话')">
                    <span>{{ userData.customer_phone }}</span>
                  </el-descriptions-item>

                  <el-descriptions-item :label="$t('user.结算方式')">
                    <span>{{ customerPayMethod[userData.customer_pay_method]  }}</span>
                  </el-descriptions-item>

                  <el-descriptions-item :label="$t('user.客户档案')">
                      <el-link type="primary" :href="userData.customer_url" target="_blank"> {{ userData.file_name }}</el-link>
                  </el-descriptions-item>
                </el-descriptions>
              </el-col>
              <div style="position: absolute;right: 20px">
                <el-link :underline="false" type="primary" @click="editUserDialog(userData)">{{ $t('common.edit') }}</el-link>
              </div>
            </el-card>
        </el-row>
      </div>


    <div class="season">
      <el-row :gutter="24">
        <h4 class="title">{{$t('userInfo.Store Information')}}</h4>
        <el-col :span="12">
          <el-table
            :data="accountData"
            border
          >
            <el-table-column
              prop="nickname"
              :label="$t('table.shopNames')"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="accountType"
              :label="$t('table.platform')"
              align="center"
              v-if="$store.getters.platformNum > 1"
            ></el-table-column>
            <el-table-column
              prop="remarkName"
              :label="$t('table.customName')"
              align="center"
            >
              <template slot-scope="{row}">
                {{row.remarkName || '-'}}
              </template>
            </el-table-column>
            <el-table-column
              prop="goodsNum"
              :label="$t('table.Listing Total')"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="orderNum"
              :label="$t('table.Total order quantity')"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="stickerNum"
              :label="$t('table.stickerNumber')"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="accountAttr"
              :label="$t('table.店铺属性')"
              align="center"
            >
              <template v-slot="{row}">
                <template v-if="row.isCBT">
                  {{$t('table.CBT')}}
                </template>
                <template v-else>
                  {{$t('table.Local')}}
                </template>
              </template>
            </el-table-column>
            <el-table-column
              prop="createTime"
              :label="$t('table.bindingTime')"
              align="center"
            >
              <template slot-scope="{row}">
                <template v-if="row.syncData === 1">
                  {{row.createTime}}
                </template>
                <template v-else>
                  {{ $t('account.collecting') }}
                </template>
              </template>
            </el-table-column>
          </el-table>

        </el-col>
      </el-row>
    </div>

    <div class="season" v-if="false">
      <el-row :gutter="24">
        <h4 class="title">{{ $t('userInfo.Warehouse Information') }}</h4>
        <el-col :span="6">
          <el-table
            :data="storageData"
            border
            show-summary
          >
            <el-table-column
              prop="size"
              :label="$t('table.boxSize')"
              align="center"
            ></el-table-column>
            <el-table-column
              prop="num"
              :label="$t('table.Inventory quantity')"
              align="center"
            ></el-table-column>

          </el-table>

        </el-col>
      </el-row>
    </div>

    <div class="season" style="min-height: 200px">
      <h4 class="title" style="margin-left: -12px">{{ $t('userInfo.remark') }}</h4>
      <div style="position: absolute">
        <el-input
          v-model="userData.remark"
          type="textarea"
          autocomplete="off"
          style="width: 900px"
          :rows="5"
        ></el-input>
        <el-button style="position: relative;right: 90px;bottom: 10px" :loading="remarkButton" @click="editRemark" type="primary">{{ $t('userInfo.Save Notes') }}</el-button>

      </div>

    </div>





    <el-dialog :title="$t('other.Modify Operations')" :visible.sync="adminAuthDialog" width="700px">
      <el-form :model="adminAuthForm">
        <el-form-item :label="$t('common.allStores')" prop="price" label-width="150px">
          <el-cascader
            style="width: 350px"
            v-model="adminAuthForm.allAccountAdmins"
            :options="formAdminOptions()"
            :props="{
              multiple:true,emitPath:false,checkStrictly:false
            }"
            clearable
            @change="chooseAllAccount"
          >
          </el-cascader>

        </el-form-item>


        <el-form-item :label="account.showName" label-width="150px" v-for="account in accountData" :key="account.accountId">
          <el-cascader
            style="width: 350px"
            v-model="adminAuthForm.adminAuthList[account.accountId]"
            :options="formAdminOptions(account.accountId)"
            :props="{
              multiple:true,emitPath:false,checkStrictly:false
            }"
            clearable
          >
          </el-cascader>

        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="adminAuthDialog = false">{{ $t('common.cancel') }}</el-button>
        <el-button type="primary" @click="changeUserAdmin" :loading="adminAuthLoading">{{ $t('common.confirm') }}</el-button>
      </div>
    </el-dialog>

    <user-setting-drawer
      ref="userSettingDrawer"
      :user-setting="userSetting"
      :user-form="userForm"
      :setting="setting"
      :warehouse-id="warehouseId"
      :warehouse-list="warehouseList"
      @submitUserForm="changeUser"
    ></user-setting-drawer>
  </div>
</template>

<script>
import {copyToClipboard, deepCopy} from "@/utils";
import {changeUserAdmin, getUserInfo, getUserLoginWithKey, saveUserInfo, saveUserRemark} from "@/api/user";
import GoodsSizePriceMixin from "@/views/setting/mixin/GoodsSizePriceMixin";
import MiddlePriceMixin from "@/views/setting/mixin/MiddlePriceMixin";
import ShipmentPriceMixin from "@/views/setting/mixin/ShipmentPriceMixin";
import TransferFeeListMixin from "@/views/setting/mixin/TransferFeeListMixin";
import user from "../../store/modules/user";
import OrderHidden from "@/views/user/components/OrderHidden.vue";
import LogisticTypePriceMixin from "@/views/setting/mixin/LogisticTypePriceMixin";
import GoodsSizePrice from "@/views/warehouse/components/GoodsSizePrice.vue";
import UserSettingDrawer from "@/views/user/components/UserSettingDrawer.vue";

export default {
  name: "userInfo",
  components: {OrderHidden, UserSettingDrawer},
  mixins: [GoodsSizePriceMixin, MiddlePriceMixin, ShipmentPriceMixin, TransferFeeListMixin, LogisticTypePriceMixin],
  data(){
    return {
      userId: 0,
      loading: false,
      accountData: [],
      userData: {
        id: 0,
        account: '',
        accountNum: 0,
        adminName: '',
        createTime: '',
        email: '',
        password: '',
        remark: '',
        status: 1,
        stickerIncome: 0,
        stickerType: 0,
        totalIncome: 0,
        totalBigMiddleFee: 0,
        totalShipmentIncome: 0,
        oneShippingAdminId: 0,
        middleTransferAdminId: 0,
        oneShippingAdminAccount: '',
        middleTransferAdminAccount: '',
        handlingChargeStatus: 1,
        orderSelectSuitIds: [],
        orderHiddenType: 1,
        storageIncome: 0, // 仓储费
        platformOneShippingPrice: [],
      },
      setting: {
        creditAmount: 0,
        goodsSizeStickerPrice: [],
        logisticTypePrice: [],
        packageMaterial: [],
        shipmentOneWeightPrice: [],
        shipmentMiddleWeightPrice: [],
        charteredCarFee: 0,
        goodsLabelFee: 0,
        boxLabelFee: 0,
        transferFeeList: [],
        middleGeneralPrice: [],
        middleExpressPrice: [],
        shipmentTableType: 1,
        logisticDropOffPrice: [],
        logisticSelfServicePrice: [],
        logisticCrossDockingPrice: [],
        logisticCustomPrice: [],
        customPrice: 0,
        storagePriceType: 1,
        warehouseStorageFeeWeightRange: [],
        platformOneShippingPrice: [], // 一件代发
      },
      settingList: [],
      adminList: [],
      dialogUserInfo: false,
      userForm:{
        id: 0,
        status: 1,
        handlingChargeStatus: 1,
        creditAmountType: 1,
        creditAmount: 0,
        goodsSizeStickerPriceType: 1,
        goodsSizeStickerPrice: [],
        logisticTypePriceType: 1,
        logisticTypePrice: {
          cross_docking: 0,
          drop_off: 0,
          self_service: 0,
        },
        packageMaterialType: 1,
        packageMaterial:[],
        shipmentTallyingType: 1,
        shipmentOneWeightPrice: [],
        shipmentMiddleWeightPrice: [],
        transferPriceType: 1,
        charteredCarFee: 0,
        goodsLabelFee: 0,
        boxLabelFee: 0,
        transferFeeList: [],
        middleGeneralPrice: [],
        middleExpressPrice: [],
        shipmentType: 1,
        shipmentTableType: 1,
        logisticDropOffPrice: [],
        logisticSelfServicePrice: [],
        logisticCrossDockingPrice: [],
        logisticCustomPrice: [],
        customPrice: 0,
        storagePriceType: 1,
        warehouseStorageFeeWeightRange: [],
        platformOneShippingPrice: [],
      },
      userSetting: {
        id: 0,
        status: 1,
        handlingChargeStatus: 1,
        creditAmountType: 1,
        creditAmount: 0,
        goodsSizeStickerPriceType: 1,
        goodsSizeStickerPrice: [],
        logisticTypePriceType: 1,
        logisticTypePrice: {
          cross_docking: 0,
          drop_off: 0,
          self_service: 0,
        },
        packageMaterialType: 1,
        packageMaterial:[],
        shipmentTallyingType: 1,
        shipmentOneWeightPrice: [],
        shipmentMiddleWeightPrice: [],
        transferPriceType: 1,
        charteredCarFee: 0,
        goodsLabelFee: 0,
        boxLabelFee: 0,
        transferFeeList: [],
        middleGeneralPrice: [],
        middleExpressPrice: [],
        shipmentType: 1,
        shipmentTableType: 1,
        logisticDropOffPrice: [],
        logisticSelfServicePrice: [],
        logisticCrossDockingPrice: [],
        logisticCustomPrice: [],
        customPrice: 0,
        storagePriceType: 1,
        warehouseStorageFeeWeightRange: [],
      },
      autoDownloadShipping: false,
      autoDownloadShippingList:[],
      autoSyncInventoryList:[],
      autoSyncInventory: false,
      syncInventoryStr: '',
      warehouseId: 0,
      settingByWarehouseList: [],
      warehouseNum: 0,
      currentWarehouseId: 0,
      adminOption: [],
      userFormLoading: false,
      remarkButton: false,
      adminAuthDialog: false,
      adminAuthLoading: false,
      adminAuthForm: {
        id: 0,
        allAccountAdmins: [],
        adminAuthList: {},
      },
      authAdmin: [],
      warehouseList: [], // 用户所属的仓库
      customerType:['无','一般客户','直客','同行'],
      customerPayMethod:['无','现金','周结','月结','60天结','到仓结'],
    };
  },
  watch: {
    currentWarehouseId(newValue, oldValue) {
      if (newValue !== oldValue) {
        const list = this.settingByWarehouseList.filter(item => item.id === newValue)
        this.userSetting = deepCopy(list[0].userSetting)
        this.userSetting.status = this.userData.status
        this.setting = deepCopy(list[0].defaultSetting)
        this.warehouseId = newValue
      }
    }
  },
  computed:{
    user() {
      return user
    },
    // 总收入
    calTotalIncome(){
      let sum = 0
      sum += this.userData.stickerIncome + this.userData.totalBigMiddleFee + this.userData.totalShipmentIncome + this.userData.storageIncome
      return sum
    },
    storageData(){
      const data = [];
      data.push({
        size: this.$t('shipment.below150'),
        num: this.userData.storageType1,
      })
      data.push({
        size: this.$t('shipment.above150'),
        num: this.userData.storageType2,
      })
      return data;
    },
    currentWarehouseStorageFeeWeightRange(){
      return this.userSetting.warehouseStorageFeeWeightRange.filter(item => item.warehouseId === this.warehouseId)
    }
  },
  created() {
    this.userId = this.$route.query.id;
    this.userForm.goodsSizeStickerPrice.push(deepCopy(this.defaultGoodsSizeStickerPrice))
    this.getData()
  },
  methods:{
    getData(){
      this.loading = true
      getUserInfo(this.userId)
        .then(res=>{
          this.loading = false
          this.userData = deepCopy(res.data)
          this.accountData = this.userData.accountList;

          this.accountData.forEach(item=>{
            this.adminAuthForm.adminAuthList[item.id] = [];
          })
          this.userSetting = deepCopy(res.info.userSetting)
          this.userSetting.status = this.userData.status
          this.setting = deepCopy(res.info.defaultSetting)
          this.warehouseList = res.info.warehouseList
          this.autoDownloadShipping = res.info.autoDownloadShipping
          this.autoSyncInventory = res.info.autoSyncInventory
          this.autoDownloadShippingList = res.info.autoDownloadShippingList
          this.autoSyncInventoryList=res.info.autoSyncInventoryList
          this.syncInventoryStr = res.info.syncInventoryStr
          this.settingByWarehouseList = res.info.settingByWarehouseList
          this.warehouseNum = res.info.warehouseNum
          this.currentWarehouseId = res.info.currentWarehouseId
          // this.warehouseId = res.info.warehouseId
          this.warehouseId = this.currentWarehouseId
        })
    },

    changeUser(){
      this.$router.go(0) // 刷新当前页面
    },

    // 展示充值窗口
    showRecharge(){
      this.dialogRecharge = true
    },
    // 复制密码
    copyPwd(){
      copyToClipboard(this.userData.password)
        .then(res=>{
          this.$successMessage('复制成功')
        })
        .catch(res=>{
          this.$errorMessage('复制失败')

        })
    },
    editUserDialog(row){
      this.$router.push({
        name: 'addUser',
         query: {
           id: row.id
         }
      })
    },
    // 修改用户信息
    showEditUser(){
      this.userForm = deepCopy(this.userSetting)
      this.userForm.id = this.userId
      this.userForm.status = this.userData.status
      this.userForm.handlingChargeStatus = this.userData.handlingChargeStatus
      this.$refs.userSettingDrawer.showDrawer()

      // this.dialogUserInfo = true;


    },
    // 提交用户表单
    submitUserForm(){
      const flag = this.checkGoodsSizePriceData(this.userForm.goodsSizeStickerPrice)
      if(!flag){
        return
      }
      // 校验数据
      if(
        !this.checkMiddleGeneral(this.userForm.middleGeneralPrice) ||
        !this.checkMiddleExpress(this.userForm.middleExpressPrice) ||
        !this.checkShipmentOneWeightPrice(this.userForm.shipmentOneWeightPrice) ||
        !this.checkShipmentMiddleWeightPrice(this.userForm.shipmentMiddleWeightPrice) ||
        !this.checkTransferFeeList(this.userForm.transferFeeList) ||
        !this.checkLogisticTypePrice(this.userForm.logisticDropOffPrice) ||
        !this.checkLogisticTypePrice(this.userForm.logisticCrossDockingPrice) ||
        !this.checkLogisticTypePrice(this.userForm.logisticSelfServicePrice) ||
        !this.checkLogisticTypePrice(this.userForm.logisticCustomPrice)
      ){
        return;
      }
      this.userFormLoading = true
      this.userForm.id = this.userId
      saveUserInfo(this.userForm)
        .then( res=>{
          this.userFormLoading = false
          if(res.error === 0){
            this.dialogUserInfo = false
            this.$successMessage(res.message)
            this.getData()
          }else{
            this.$errorMessage(res.message)
          }
        })
    },
    // 修改备注
    editRemark(){
      const params = {
        id: this.userId,
        remark: this.userData.remark,
      }
      this.remarkButton = true;
      saveUserRemark(params)
        .then(res=>{
          this.remarkButton = false;
          this.$successMessage(res.message)
          this.getData()
        })
    },
    showAdminAuth(){
      this.adminAuthDialog = true;
    },
    formAdminOptions(accountId = 0){
      const formAdminOptions = [];
      this.adminOption.forEach(item=>{
        let disabled = item.authType === 1;
        if(!disabled){
          if(accountId > 0){
            disabled = this.adminAuthForm.allAccountAdmins.some(adminId=> adminId === item.id)
          }
        }

        formAdminOptions.push({
          label:item.account,
          value:item.id,
          disabled: disabled
        })
      })

      return formAdminOptions
    },
    chooseAllAccount(){
      this.adminAuthForm.allAccountAdmins.forEach(adminId=>{
        for (let accountId in this.adminAuthForm.adminAuthList) {
          const index = this.adminAuthForm.adminAuthList[accountId].indexOf(adminId)
          if(index !== -1){
            this.adminAuthForm.adminAuthList[accountId].splice(index,1)
          }
        }
      })
    },
    changeUserAdmin(){
      const postData = deepCopy(this.adminAuthForm);
      postData.userId = this.userId
      this.adminAuthLoading = true
      changeUserAdmin(postData)
        .then(res=>{
          this.adminAuthLoading = false
          if(res.error === 0){
            this.adminAuthDialog = false;
            this.$successMessage(res.message)
            this.getData()
          }else{
            this.$errorMessage(res.message)
          }
        })
    },
    jumpUser(){
      getUserLoginWithKey(this.userId)
        .then(res=>{
          window.open(res.data.url,'_blank')
        })
    },
    // 触发子组件的dialog
    showOrderHiddenDialog(){
      this.$refs.orderHiddenRef.$emit('showDialog')
    },
  }
}
</script>

<style>
.userinfo-form{
  .el-form-item__label{
    color: #000000;
    font-weight: bold;
    font-size: 14px;
  }
}

</style>

<style scoped lang="scss">
.wrap {
  padding: 30px 30px;
  .header{
    display: flex;
    justify-content: space-between;
  }
  .content{
    padding: 20px 0 0;
  }
}
.season{
  .item{
    font-size: 14px;
    font-weight: normal;
    line-height: 1.5;
    padding-bottom: 10px;
    div{
      display: inline-flex;
    }
    .label{
      width: 180px;
    }
    .value{
      display: inline;
    }
    .option{
      float: right;
    }
  }
}
.recharge-title{
  color: #FF0000;
  margin-top: -20px;
  margin-bottom: 20px;
}
.dialog-info{
  font-size: 13px;
  color: #FF0000;
}
.userinfo-form{
  .form-card{
    border-radius: 2px;
    border: 1px solid #f2f2f2;
    padding: 10px 15px 0px;
    position: relative;
    .form-title{
      font-weight: bold;
      font-size: 14px;
      color: #409EFF;
      margin-bottom: 10px;
    }
    .form-tag{
      //width: 60px;
      padding: 0px 10px;
      height: 25px;
      line-height: 25px;
      text-align: center;
      font-size: 13px;
      position: absolute;
      right: 0;
      top: 0;
      cursor: pointer;
      color: #ffffff;
      font-weight: bold;
      border-radius: 2px;
    }
    .form-tag-diy{
      background-color: #ff0000;
    }
    .form-tag-default{
      background-color: #409eff;
    }
    .goods-size-price-content{
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      margin-bottom: 10px;
      .weight{
        width: 200px;
      }
      .PSC-first{
        width: 200px;
      }
      .PSC-append{
        width: 250px;
      }
    }
    .middle-input{
      display: flex;
      margin-bottom: 10px;
      .weight{
        width: 200px;
      }
      .price{
        width: 200px;
      }
    }
  }

}
</style>
